package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysGoodsEarnMapper;
import com.ruoyi.system.domain.SysGoodsEarn;
import com.ruoyi.system.service.ISysGoodsEarnService;

/**
 * 商品库存Service业务层处理
 *
 * @author ruoyi
 * @date 2022-10-30
 */
@Service
public class SysGoodsEarnServiceImpl implements ISysGoodsEarnService
{
    @Autowired
    private SysGoodsEarnMapper sysGoodsEarnMapper;

    /**
     * 查询商品库存
     *
     * @param outGoodsId 商品库存主键
     * @return 商品库存
     */
    @Override
    public SysGoodsEarn selectSysGoodsEarnByOutGoodsId(Long outGoodsId)
    {
        return sysGoodsEarnMapper.selectSysGoodsEarnByOutGoodsId(outGoodsId);
    }

    /**
     * 查询商品库存列表
     *
     * @param sysGoodsEarn 商品库存
     * @return 商品库存
     */
    @Override
    public List<SysGoodsEarn> selectSysGoodsEarnList(SysGoodsEarn sysGoodsEarn)
    {
        return sysGoodsEarnMapper.selectSysGoodsEarnList(sysGoodsEarn);
    }

    /**
     * 新增商品库存
     *
     * @param sysGoodsEarn 商品库存
     * @return 结果
     */
    @Override
    public int insertSysGoodsEarn(SysGoodsEarn sysGoodsEarn)
    {
        return sysGoodsEarnMapper.insertSysGoodsEarn(sysGoodsEarn);
    }

    /**
     * 修改商品库存
     *
     * @param sysGoodsEarn 商品库存
     * @return 结果
     */
    @Override
    public int updateSysGoodsEarn(SysGoodsEarn sysGoodsEarn)
    {
        return sysGoodsEarnMapper.updateSysGoodsEarn(sysGoodsEarn);
    }

    /**
     * 批量删除商品库存
     *
     * @param outGoodsIds 需要删除的商品库存主键
     * @return 结果
     */
    @Override
    public int deleteSysGoodsEarnByOutGoodsIds(Long[] outGoodsIds)
    {
        return sysGoodsEarnMapper.deleteSysGoodsEarnByOutGoodsIds(outGoodsIds);
    }

    /**
     * 删除商品库存信息
     *
     * @param outGoodsId 商品库存主键
     * @return 结果
     */
    @Override
    public int deleteSysGoodsEarnByOutGoodsId(Long outGoodsId)
    {
        return sysGoodsEarnMapper.deleteSysGoodsEarnByOutGoodsId(outGoodsId);
    }
}
